home *** CD-ROM | disk | FTP | other *** search
/ Champak 26 (Anniversary Edition) / Volume 26 [Anniversary Edition] - JOGO DISK .iso / DEPOSITO / sb_bust.swf / scripts / __Packages / CharacterObj.as next >
Text File  |  2006-07-26  |  1KB  |  45 lines

  1. class CharacterObj
  2. {
  3.    function CharacterObj(l_RefMov)
  4.    {
  5.       this.RefMov = l_RefMov;
  6.       this.Nom = this.RefMov._name;
  7.       this.State = "Wait";
  8.       this.StateOld = "Wait";
  9.       this.MaxHealth = 100;
  10.       this.Health = 100;
  11.       this.CanBeHit = true;
  12.       this.NbFace = 3;
  13.       this.WillWin = false;
  14.    }
  15.    function CheckControl()
  16.    {
  17.    }
  18.    function ShowHealth()
  19.    {
  20.       var _loc3_ = 101 - int(this.Health / this.MaxHealth * 100);
  21.       if(_global.C._parent.Interface[this.Nom + "Health"]._currentframe < _loc3_)
  22.       {
  23.          _global.C._parent.Interface[this.Nom + "Health"].nextFrame();
  24.       }
  25.    }
  26.    function ChangeState(l_NewAction)
  27.    {
  28.       if(this.StateOld != l_NewAction)
  29.       {
  30.          this.StateOld = this.State;
  31.          this.State = l_NewAction;
  32.          this.RefMov.gotoAndStop(l_NewAction);
  33.       }
  34.    }
  35.    function Actions()
  36.    {
  37.       this.ChangeState(this.State);
  38.       this.CheckControl();
  39.       this.ChangeState(this.State);
  40.       this[this.State]();
  41.       this.ChangeState(this.State);
  42.       this.ShowHealth();
  43.    }
  44. }
  45.